var comSample_locLang=new comLang("comSample");
var comSample = new Class({
	Extends:WFComponentWindow,
    options: {
        name: 'comSample',
        title: comSample_locLang.label('title'),
        loadCSS: true,
        switchBtn_leftTip: comSample_locLang.label('centrally_managed'),
        switchBtn_rightTip: comSample_locLang.label('locally_managed'),
        switch_message: comSample_locLang.label('switch_message')                  
    },
    render: function(){
        new Element('div',{'class':'sample_title','html':this.options.title}).inject(this.container,'bottom');
        this.setData(this.options.data);
        //get targets
        var arrTargets = this.getTargets();
        if(arrTargets && arrTargets.length > 0){
            arrTargets.each(function(target,index){
                if(target && target.TargetUrl){
                    if (target.TargetUrl.indexOf(';') == -1){
                        //only one url for this target
                        new Element('div',{'html':target.TargetUrl}).inject(this.container,'bottom');
                    }else{
                        //more than one url for this target
                        var arrTargetUrls = target.TargetUrl.split(';');
                        arrTargetUrls.each(function(targetUrl,index){
                            new Element('div',{'html':targetUrl}).inject(this.container,'bottom');
                        }.bind(this));
                    }
                }
            }.bind(this));
        }
    },
    getData: function(){
        //return settings in UI
        //this.data.settings.test1 = "yaya";
        return JSON.encode(this.data);
    },
    setData: function(objectData){
        this.data = objectData;
    },
    setReadOnly: function(){
        //set option to readonly 
    },
    validate: function(){
        //validate UI settings
       return true;
    }
});
